@(node: Option[spray.site.ContentNode] = None)

<aside class="span3 sidebar">

  <!--post content-->
  @item(node: spray.site.ContentNode) = {
    <li>
      <a href="@node.absoluteUri"><i class="icon-chevron-right"></i> @node.name</a>
      @if(!node.isLeaf) {
        <ul class="nav nav-list">
          @node.children.map(item)
        </ul>
      }
    </li>
  }

  @node.map { node =>
    @if(node.post.showStructure) {
      <div class="well" style="padding: 8px 0;">
        <ul class="nav nav-list">
          <li class="nav-header">Post Content</li>
          @node.children.map(item)
        </ul>
      </div>
    }
  }

  <!--social media widget-->
  <div class="widget widget_social">
    <h3>Connect!</h3>
    <a href="/blog/feed/" data-rel="tooltip" title="Atom Feed" class="sm-icon sm-icon-rss"></a>
    <a href="https://github.com/spray/spray/tree/master/docs/blog" data-rel="tooltip" data-position="bottom" title="This blog on github" class="sm-icon sm-icon-github"></a>
    <a href="/contact/" data-rel="tooltip" data-position="bottom" title="Email"  class="sm-icon sm-icon-e-mail"></a>
    <a href="/contact/" data-rel="tooltip" data-position="bottom" title="Skype"  class="sm-icon sm-icon-skype"></a>
    <a href="http://twitter.com/sprayio" data-position="bottom" data-rel="tooltip" title="Follow Us on Twitter" class="sm-icon sm-icon-twitter"></a>
  </div>

  <!--text widget-->
  <div class="widget widget_text">
    <h3>Want to be heard?</h3>
    <div class="textwidget">
      <p>
        This blog is open for content from <em>spray</em> users.
        If you have material that you'd like to contribute shoot us an email or, even better, send us a pull
        request!
      </p>
      <p><a href="/blog/2012-12-01-welcome-to-the-spray-blog/"><span class="label">More Details</span></a></p>
    </div>
  </div>

  <!--categories widget-->
  <div class="widget widget_categories">
    <h3>Categories</h3>
    <ul>
      <li class="cat-item">
        <a title="View all posts" href="/blog/">all</a>(@spray.site.Main.blog.root.children.size)
      </li>
      @spray.site.Main.blog.posts.map { case (tag, posts) =>
        <li class="cat-item">
          <a title="View all posts tagged with @tag" href="/blog/category/@tag/">@tag</a>(@posts.size)
        </li>
      }
    </ul>
  </div>

  <!--twitter widget-->
  <div class="widget widget_twitter">
    <h3>
      <em>spray</em> on Twitter
      <a class="followBtn" href="https://twitter.com/#!/sprayio"><span class="label">follow</span></a>
    </h3>
    <div class="twitter" data-topdate="true" data-count="3" data-username="sprayio"></div>
  </div>

</aside>